; Music of Black Tiger (1989) (U.S. Gold)
; Ripped by Megachur the 17/02/2007

	write "BLACKTIG.BIN"

music_date_rip	equ &1127
music_adr	equ &f1ec
first_theme	equ 1
last_theme	equ 4

	read "music_header_v1_0.asm"

	db #33,#01,#05,#0f,#09,#0f,#0e,#0b
	db #0f,#0e,#66,#00,#45,#07,#55,#06
	db #01,#07,#0f,#2a
.lf200
	db #0d,#20,#01,#00,#01,#0a,#0a,#0a
	db #0a,#09,#09,#09,#09,#09,#08,#08
	db #08,#08,#08,#08,#08,#08,#08,#08
	db #08,#08,#07,#07,#07,#07,#07,#07
	db #07,#07,#07,#07,#00,#01,#01,#01
	db #01,#01,#01,#01,#01,#01,#01,#01
	db #01,#01,#01,#01,#01,#01,#01,#01
	db #01,#01,#01,#01,#01,#01,#01,#01
	db #01,#01,#01,#01,#01
.lf245
	db #0d,#20,#0c,#0c,#01,#08,#07,#06
	db #05,#03,#01,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#0c,#0c,#02
	db #0e,#04,#10,#06,#12,#08,#14,#0a
	db #0c,#0c,#0c,#0c,#0c,#10,#11,#12
	db #13,#14,#15,#16,#17,#18,#19,#1a
	db #1b,#1c,#1d,#1e,#1f
.lf28a
	db #0d,#20,#10,#10,#01,#08,#07,#06
	db #05,#03,#01,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#10,#10,#10
	db #10,#10,#11,#12,#13,#14,#15,#16
	db #17,#18,#19,#1a,#1b,#10,#11,#12
	db #13,#14,#15,#16,#17,#18,#19,#1a
	db #1b,#1c,#1d,#1e,#1f
.lf2cf
	db #13,#20,#01,#00,#01,#0e,#0e,#0d
	db #0d,#0c,#0c,#0b,#0b,#0a,#0a,#09
	db #09,#08,#08,#07,#07,#06,#06,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#01,#00,#01
	db #00,#ff,#00,#ff,#00,#ff,#00,#ff
	db #00,#01,#00,#01,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00
.lf314
	db #13,#09,#01,#00,#01,#0b,#0b,#0b
	db #0b,#0b,#0b,#0b,#0b,#ff,#02,#02
.lf32b equ $ + 7
	db #fe,#fe,#fe,#fe,#02,#02,#00,#13
	db #09,#01,#00,#01,#0c,#0c,#0b,#0b
	db #0a,#0a,#0b,#0b,#ff,#01,#01,#ff
.lf342 equ $ + 6
	db #ff,#ff,#ff,#01,#01,#00,#13,#02
.lf34b equ $ + 7
	db #01,#00,#01,#00,#00,#00,#00,#13
	db #09,#01,#00,#01,#06,#06,#05,#05
	db #06,#06,#05,#05,#ff,#ff,#01,#01
.lf362 equ $ + 6
	db #ff,#ff,#01,#01,#ff,#00,#13,#20
	db #01,#00,#01,#0e,#0d,#0c,#0b,#0a
	db #0a,#0a,#0a,#0a,#0a,#0a,#0a,#0a
	db #0a,#0a,#0a,#0a,#0a,#0a,#0a,#0a
	db #0a,#0a,#0a,#0a,#0a,#0a,#0a,#0a
	db #0a,#0a,#0a,#01,#00,#01,#00,#ff
	db #00,#ff,#00,#ff,#00,#ff,#00,#01
	db #00,#01,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
.lf3a7 equ $ + 3
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00
	dw #0e29,#0d5d,#0c9c,#0be7
	dw #0b3c,#0a9b,#0a02,#0973
	dw #08eb,#086b,#07f2,#0780
	dw #0714,#06ae,#064e,#05f4
	dw #059e,#054d,#0501,#04b9
	dw #0475,#0435,#03f9,#03c0
	dw #038a,#0357,#0327,#02fa
	dw #02cf,#02a7,#0281,#025d
	dw #023b,#021b,#01fc,#01e0
	dw #01c5,#01ac,#0194,#017d
	dw #0168,#0153,#0140,#012e
	dw #011d,#010d,#00fe,#00f0
	dw #00e2,#00d6,#00ca,#00be
	dw #00b4,#00aa,#00a0,#0097
	dw #008f,#0087,#007f,#0078
	dw #0071,#006b,#0065,#005f
	dw #005a,#0055,#0050,#004c
	dw #0047,#0043,#0040,#003c
	dw #0039,#0035,#0032,#0030
	dw #002d,#002a,#0028,#0026
	dw #0024,#0022,#0020,#001e
	dw #001c,#001b,#0019,#0018
	dw #0016,#0015,#0014,#0013
	dw #0012,#0011,#0010,#000f
	db #88,#01,#0c,#87,#0c,#06,#88,#01
	db #0c,#01,#06,#87,#0c,#0c,#88,#01
	db #0c,#87,#0c,#06,#88,#01,#0c,#01
	db #06,#87,#0c,#06,#0c,#06,#88,#01
	db #0c,#87,#0c,#06,#88,#01,#0c,#01
	db #06,#87,#0c,#0c,#88,#01,#0c,#87
	db #0c,#06,#88,#01,#0c,#87,#0c,#06
	db #0c,#06,#0c,#06,#94
.lf4bc
	db #9e,#c8,#95,#ff,#00,#7f,#f4,#9d
.lf4c5 equ $ + 1
	db #ff,#84,#9e,#c8,#00,#0c,#00,#0c
	db #00,#0c,#00,#0c,#00,#0c,#00,#0c
	db #37,#0c,#35,#0c,#00,#0c,#00,#0c
	db #00,#0c,#00,#0c,#00,#0c,#00,#0c
.lf4ea equ $ + 6
	db #35,#0c,#30,#0c,#9d,#ff,#81,#9e
	db #02,#84,#00,#0c,#00,#0c,#00,#0c
	db #00,#0c,#00,#0c,#00,#0c,#81,#37
	db #0c,#35,#0c,#84,#00,#0c,#00,#0c
	db #00,#0c,#00,#0c,#00,#0c,#00,#0c
	db #81,#35,#0c,#30,#0c,#9d,#9e,#c8
	db #24,#06,#26,#0c,#26,#0c,#26,#0c
	db #26,#0c,#26,#0c,#26,#06,#2b,#0c
	db #29,#0c,#24,#06,#26,#0c,#26,#0c
	db #26,#0c,#26,#0c,#26,#0c,#26,#06
	db #29,#0c,#24,#0c,#9d,#ff,#85,#39
	db #03,#3c,#03,#40,#03,#94,#37,#03
.lf549 equ $ + 5
	db #3b,#03,#3e,#03,#94,#9e,#c8,#95
	db #15,#00,#3a,#f5,#39,#03,#95,#15
	db #00,#42,#f5,#37,#03,#9d,#81,#13
	db #0c,#13,#0c,#1f,#0c,#13,#0c,#1f
	db #0c,#1f,#0c,#13,#0c,#1f,#0c,#94
.lf56c
	db #9e,#c8,#95,#02,#02,#5a,#f5,#95
.lf579 equ $ + 5
	db #02,#00,#5a,#f5,#9d,#9e,#02,#83
	db #2d,#90,#34,#30,#32,#48,#32,#0c
	db #30,#0c,#2f,#48,#2d,#0c,#2f,#0c
	db #2d,#30,#34,#30,#39,#30,#40,#1e
	db #3e,#5a,#3e,#0c,#3c,#0c,#3b,#60
	db #3e,#18,#40,#78,#45,#18,#43,#60
	db #40,#0c,#3e,#0c,#3b,#18,#39,#18
	db #37,#18,#34,#18,#37,#12,#39,#96
	db #37,#03,#38,#03,#37,#d2,#ff,#88
	db #01,#0c,#01,#0c,#87,#01,#0c,#88
	db #01,#0c,#94,#83,#25,#12,#28,#06
	db #2c,#06,#31,#06,#34,#06,#38,#06
	db #3d,#06,#40,#06,#44,#06,#49,#06
	db #4c,#06,#50,#06,#55,#06,#4c,#06
	db #49,#06,#44,#06,#40,#06,#3d,#06
	db #38,#06,#34,#06,#31,#06,#2c,#06
.lf5f5 equ $ + 1
	db #94,#9e,#c8,#95,#07,#00,#bb,#f5
	db #88,#01,#0c,#01,#0c,#87,#01,#06
	db #01,#06,#01,#0c,#95,#07,#00,#bb
	db #f5,#88,#01,#0c,#01,#0c,#87,#01
	db #06,#01,#06,#01,#0c,#95,#07,#00
	db #bb,#f5,#88,#01,#0c,#01,#0c,#87
	db #01,#06,#01,#06,#01,#0c,#83,#95
	db #01,#08,#c7,#f5,#9d,#0c,#0c,#0f
	db #0c,#13,#0c,#0f,#0c,#94,#0c,#0c
	db #10,#0c,#13,#0c,#0f,#0c,#94,#0c
	db #0c,#0f,#0c,#13,#0c,#0f,#0c,#0d
	db #0c,#11,#0c,#14,#0c,#11,#0c,#94
	db #83,#25,#0c,#28,#06,#2c,#06,#31
	db #06,#34,#06,#38,#06,#3d,#06,#40
	db #06,#44,#06,#49,#06,#4c,#06,#50
	db #06,#55,#06,#4c,#06,#49,#06,#44
	db #06,#40,#06,#3d,#06,#38,#06,#34
	db #06,#31,#06,#2c,#06,#28,#06,#94
.lf684
	db #9e,#c8,#81,#95,#03,#09,#43,#f6
	db #95,#01,#0d,#31,#f6,#95,#01,#08
	db #31,#f6,#95,#07,#09,#43,#f6,#25
	db #18,#29,#18,#2d,#18,#31,#18,#95
	db #01,#08,#54,#f6,#9d,#83,#2d,#18
	db #30,#18,#2e,#0c,#29,#0c,#26,#18
	db #2d,#0c,#2f,#0c,#30,#0c,#2d,#0c
	db #2e,#0c,#29,#0c,#26,#18,#2d,#0c
	db #2f,#0c,#30,#0c,#2d,#0c,#2e,#0c
	db #30,#0c,#31,#0c,#2e,#0c,#31,#0c
	db #33,#0c,#34,#0c,#31,#0c,#33,#0c
	db #2f,#0c,#2c,#18,#94,#31,#18,#2f
	db #0c,#2d,#0c,#2c,#24,#2c,#0c,#2a
	db #0c,#28,#0c,#2a,#0c,#2c,#0c,#2a
	db #0c,#28,#0c,#2a,#0c,#2c,#0c,#28
	db #18,#27,#0c,#28,#0c,#24,#24,#24
	db #0c,#25,#0c,#27,#0c,#29,#0c,#2b
	db #0c,#2d,#0c,#2f,#0c,#31,#0c,#33
	db #0c,#94,#83,#25,#06,#28,#06,#2c
	db #06,#31,#06,#34,#06,#38,#06,#3d
	db #06,#40,#06,#44,#06,#49,#06,#4c
	db #06,#50,#06,#55,#06,#4c,#06,#49
	db #06,#44,#06,#40,#06,#3d,#06,#38
	db #06,#34,#06,#31,#06,#2c,#06,#28
.lf748 equ $ + 4
	db #06,#25,#06,#94,#9e,#02,#95,#01
	db #00,#a9,#f6,#95,#01,#0c,#a9,#f6
	db #95,#01,#0c,#e1,#f6,#95,#01,#08
	db #16,#f7,#9d,#ff,#88,#01,#0c,#80
	db #01,#0c,#87,#0c,#0c,#80,#01,#0c
	db #94,#87,#0c,#06,#0c,#06,#0c,#06
	db #0c,#06,#0c,#06,#0c,#06,#0c,#06
	db #0c,#06,#94,#88,#01,#0c,#80,#01
	db #0c,#87,#0c,#06,#0c,#06,#0c,#06
.lf78f equ $ + 3
	db #0c,#06,#94,#9e,#03,#95,#07,#00
	db #60,#f7,#95,#01,#00,#7f,#f7,#95
	db #07,#00,#60,#f7,#95,#01,#00,#6d
	db #f7,#95,#07,#00,#60,#f7,#95,#01
	db #00,#7f,#f7,#95,#06,#00,#60,#f7
	db #95,#02,#00,#6d,#f7,#9d,#9e,#10
	db #88,#01,#0c,#80,#01,#0c,#87,#01
	db #0c,#80,#01,#0c,#9d,#87,#9e,#20
	db #0c,#06,#0c,#06,#0c,#06,#0c,#06
	db #9d,#0c,#0c,#0c,#0c,#24,#0c,#0c
	db #0c,#94,#0c,#0c,#0c,#0c,#24,#0c
	db #94,#0c,#18,#0c,#0c,#24,#0c,#0c
	db #0c,#94,#81,#0c,#0c,#0c,#0c,#24
	db #0c,#0c,#0c,#94,#0c,#0c,#0c,#0c
	db #24,#0c,#94,#0c,#18,#0c,#0c,#24
	db #0c,#0c,#0c,#94,#32,#0c,#32,#0c
	db #35,#06,#32,#06,#35,#06,#39,#0c
	db #32,#06,#37,#0c,#35,#0c,#32,#06
	db #35,#06,#37,#0c,#37,#0c,#37,#06
	db #35,#06,#37,#06,#37,#0c,#35,#06
	db #32,#06,#30,#06,#32,#06,#30,#06
	db #2d,#06,#2b,#06,#94,#2d,#06,#30
	db #06,#32,#06,#30,#06,#32,#03,#30
	db #03,#32,#03,#30,#03,#32,#06,#32
	db #06,#35,#06,#35,#06,#35,#06,#35
	db #06,#35,#0c,#35,#06,#34,#06,#37
	db #0c,#37,#0c,#37,#0c,#3a,#3c,#94
.lf864
	db #9e,#0c,#95,#01,#0e,#ee,#f7,#95
	db #01,#11,#d5,#f7,#95,#01,#13,#d5
	db #f7,#95,#01,#0c,#d5,#f7,#95,#01
	db #0e,#ee,#f7,#95,#01,#11,#d5,#f7
	db #95,#01,#13,#de,#f7,#95,#01,#16
	db #e5,#f7,#9d,#22,#c0,#00,#06,#32
	db #30,#35,#30,#37,#30,#30,#30,#32
	db #30,#35,#30,#37,#30,#3a,#30,#95
	db #01,#00,#08,#f8,#95,#01,#00,#39
	db #f8,#ff,#83,#32,#0c,#32,#18,#32
	db #0c,#35,#0c,#32,#18,#32,#0c,#37
	db #0c,#35,#0c,#37,#0c,#32,#18,#30
	db #18,#31,#0c,#94,#32,#0c,#32,#18
	db #32,#0c,#35,#0c,#32,#18,#32,#0c
	db #37,#0c,#35,#0c,#37,#0c,#39,#06
	db #3a,#36,#94,#39,#06,#37,#06,#35
	db #0c,#32,#0c,#32,#06,#35,#0c,#32
	db #06,#35,#0c,#35,#06,#32,#06,#35
	db #06,#32,#06,#35,#06,#37,#0c,#35
	db #06,#37,#0c,#35,#06,#37,#0c,#35
	db #06,#30,#0c,#30,#0c,#30,#06,#31
	db #06,#94,#39,#06,#37,#06,#35,#0c
	db #32,#0c,#32,#06,#35,#0c,#32,#06
	db #35,#0c,#35,#06,#32,#06,#35,#06
	db #32,#06,#35,#06,#37,#0c,#35,#06
	db #37,#0c,#35,#06,#37,#0c,#35,#06
	db #39,#03,#3a,#15,#3a,#03,#37,#03
.lf941 equ $ + 5
	db #35,#03,#33,#03,#94,#00,#c0,#00
	db #c0,#00,#c0,#00,#c0,#00,#c0,#00
	db #c0,#00,#c0,#00,#c0,#9e,#02,#95
	db #01,#00,#ae,#f8,#95,#01,#00,#c8
	db #f8,#95,#01,#00,#df,#f8,#95,#01
	db #00,#0e,#f9,#95,#01,#00,#08,#f8
	db #95,#01,#00,#39,#f8,#95,#01,#00
	db #08,#f8,#95,#01,#00,#39,#f8,#9d
	db #3a,#c0,#32,#30,#35,#30,#37,#30
	db #30,#30,#32,#30,#35,#30,#37,#30
	db #3a,#30,#95,#01,#00,#08,#f8,#95
	db #01,#00,#39,#f8,#ff
.lf999
	dw lf4bc,lf4c5,lf4ea,lf549
	dw lf56c,lf579,lf748,lf684
.lf9af equ $ + 6
	dw lf5f5,lf78f,lf864,lf941
	dw #0000
.lf9b3
	dw lf200,lf2cf,lf314,lf32b
	dw lf342,lf34b,lf362,lf245
.lf9c3
	dw lf28a,#0000
.lf9c7
	jp lfd3d
.lf9d1 equ $ + 7
.lf9cf equ $ + 5
.lf9ce equ $ + 4
.lf9cd equ $ + 3
.lf9cc equ $ + 2
.lf9cb equ $ + 1
.lf9ca
	db #00,#00,#00,#00,#00,#00,#00,#00
.lf9d9 equ $ + 7
.lf9d7 equ $ + 5
	db #00,#00,#00,#00,#00,#00,#00,#00
.lf9e1 equ $ + 7
	db #00,#00,#00,#00,#00,#00,#00,#00
.lf9e9 equ $ + 7
.lf9e7 equ $ + 5
	db #00,#00,#00,#00,#00,#00,#00,#00
.lf9f1 equ $ + 7
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00
.lfa01
	db #00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#01,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#02,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
.lfa49 equ $ + 5
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#01,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#02,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00
.lfa91
	push de
	push bc
	push hl
	push ix
	push iy
	call lfaa3
	pop iy
	pop ix
	pop hl
	pop bc
	pop de
;	ret             ; modified by Megachur
;
.init_music	; a=1,2,3,4(main theme)
.lfaa3
;
	ld (lf9cb),a
	ld a,1		;ld a,c          ; c = 1 !!!
	ld (lf9cc),a
	ld a,(lf9cb)
	ld iy,lf9e1
	cp #ff
	jp z,lfbe5
	dec a
	jp m,lfb60
	call lfb60
	ld a,#01
	ld (lf9ca),a
	call lfafa
	ld a,(lf9cb)
	dec a
	ld e,a
	add a
	add e
	add a
	ld e,a
	ld d,#00
	ld hl,lf999
	add hl,de
	ex de,hl
	ld hl,lf9af
	sbc hl,de
	jp c,lfb60
	ex de,hl
	ld ix,lfa01
	ld b,#03
.lfae4
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (ix+#0c),e
	ld (ix+#0d),d
	ld (ix+#0a),#01
	ld de,#0018
	add ix,de
	djnz lfae4
	ret
.lfafa
	push ix
	ld ix,lfa49
	ld hl,lf9d9
	ld a,(lf9cc)
	ld c,a
	xor a
	ld de,#0018
.lfb0b
	dec c
	jp m,lfb16
	ld (ix+#05),#ff
	ld (hl),#00
	inc hl
.lfb16
	add ix,de
	inc a
	cp #03
	jr c,lfb0b
	pop ix
	ret
.lfb20
	push ix
	ld ix,lfa49
	ld b,#03
	ld de,#0018
.lfb2b
	ld a,(ix+#05)
	inc a
	jr nz,lfb35
	ld (ix+#05),#00
.lfb35
	add ix,de
	djnz lfb2b
	pop ix
	ret
	push iy
	push ix
	pop iy
	ld de,#0018
	ld a,(iy+#05)
	cp (ix+#1d)
	jr c,lfb4f
	add iy,de
.lfb4f
	ld a,(iy+#05)
	cp (ix+#35)
	jr c,lfb59
	add iy,de
.lfb59
	push iy
	pop ix
	pop iy
	ret
.lfb60
	ld ix,lfa01
	ld b,#03
	ld hl,lf9e9
	ld de,#0018
	ld a,#00
.lfb6e
	ld (hl),a
	inc hl
	ld (ix+#05),a
	ld (ix+#0e),a
	ld (ix+#0f),a
	ld (ix+#13),a
	ld (ix+#14),a
	ld (ix+#06),a
	add ix,de
	djnz lfb6e
	ld (lf9ce),a
	ld (lf9ca),a
	jp lfb20
.lfb8f
	ld (ix+#06),#00
	ld (ix+#03),l
	ld (ix+#04),h
	ld a,(hl)
	inc hl
	ld (ix+#07),a
	ld a,(hl)
	inc hl
	ld (ix+#08),a
	ld a,(hl)
	inc hl
	ld (ix+#01),a
	ld a,(hl)
	inc hl
	ld (ix+#02),a
	ld a,(hl)
	ld (ix+#05),a
	ld a,(lf9cd)
	ld (ix+#09),a
	ld a,(ix+#07)
	ld c,#00
	rra
	rra
	rra
	rra
	rl c
	sla c
	sla c
	rra
	rl c
	ld b,#09
	ld e,(ix+#00)
.lfbce
	dec e
	jp m,lfbd8
	sla b
	sla c
	jr lfbce
.lfbd8
	ld a,c
	xor b
	ld b,a
	ld a,c
	cpl
	and (iy+#07)
	or b
	ld (iy+#07),a
	ret
.lfbe5
	ld a,#10
	ld (lf9ce),a
	ld a,c
	ld (lf9d1),a
	ld a,#00
	ld (lf9cf),a
	ret
.lfbf4
	ld a,(lf9ce)
	and a
	ret z
	ld a,(lf9cf)
	dec a
	ld (lf9cf),a
	jp p,lfc19
	ld a,(lf9d1)
	ld (lf9cf),a
	ld a,(lf9ce)
	dec a
	ld (lf9ce),a
	jr nz,lfc19
	ld a,#00
	ld c,#00
	jp lfa91
.lfc19
	ld hl,lf9e9
	ld b,#03
.lfc1e
	ld d,(hl)
	ld a,(lf9ce)
	ld e,a
	xor a
	dec e
	jp m,lfc2d
.lfc28
	add d
	dec e
	jp p,lfc28
.lfc2d
	srl a
	srl a
	srl a
	srl a
	ld (hl),a
	inc hl
	djnz lfc1e
	ret
.lfc3a
	ld b,#03
.lfc3c
	ld a,(ix+#05)
	and a
	jp z,lfcd8
	inc a
	jp z,lfcd8
	ld l,(ix+#03)
	ld h,(ix+#04)
	ld a,(ix+#06)
	add #05
	ld e,a
	ld d,#00
	add hl,de
	bit 0,(ix+#07)
	jr z,lfc91
	ld a,(hl)
	cp #fe
	jr nz,lfc6b
	inc (ix+#06)
	inc (ix+#06)
	inc hl
	ld a,(hl)
	jr lfc3c
.lfc6b
	cp #ff
	jr nz,lfc75
	ld (ix+#06),#00
	jr lfc3c
.lfc75
	ld c,a
	ld a,(ix+#00)
	add #08
	ld (lfc80),a
.lfc80 equ $ + 2
	ld (iy+#00),c
	ld a,c
	and a
	jr nz,lfc8b
	ld (ix+#05),#00
	jr lfcd8
.lfc8b
	ld e,(ix+#08)
	ld d,#00
	add hl,de
.lfc91
	bit 1,(ix+#07)
	jr z,lfccb
	ld e,(hl)
	ld d,#00
	bit 7,e
	jr z,lfc9f
	dec d
.lfc9f
	push hl
	ld l,(ix+#01)
	ld h,(ix+#02)
	add hl,de
	ld (ix+#01),l
	ld (ix+#02),h
	pop hl
	ld a,(ix+#00)
	add a
	ld (lfcbe),a
	inc a
	ld (lfcc4),a
	ld a,(ix+#01)
.lfcbe equ $ + 2
	ld (iy+#00),a
	ld a,(ix+#02)
.lfcc4 equ $ + 2
	ld (iy+#00),a
	ld e,(ix+#08)
	ld d,#00
	add hl,de
.lfccb
	bit 2,(ix+#07)
	jr z,lfcd5
	ld a,(hl)
	ld (iy+#06),a
.lfcd5
	inc (ix+#06)
.lfcd8
	ld de,#0018
	add ix,de
	dec b
	jp nz,lfc3c
	ret
;
.play_music	;fce2
;
	push af
	push bc
	push de
	push hl
	push ix
	push iy
.lfcea
	call lfeea
	ld a,#ff
	ld (lf9d7),a
	ld (lf9e7),a
	ld iy,lf9e1
	ld ix,lfa01
	call lfc3a
	ld iy,lf9d1
	ld ix,lfa49
	call lfc3a
	call lfbf4
	call lfd5d
	pop iy
	pop ix
	pop hl
	pop de
	pop bc
	pop af
	ret
	db #00,#00
	ld a,e
	cp #08
	jr c,lfd27
	cp #0b
	jr nc,lfd27
	srl d
.lfd27
	ld hl,lf9f1
	ld c,e
	ld b,#00
	add hl,bc
	ld a,(hl)
	cp d
	ret z
	ld (hl),d
	ld bc,#fffd
	out (c),e
	ld bc,#bffd
	out (c),d
	ret
.lfd3d
	ld a,e
	ld c,d
	ld b,#f4
	out (c),a
	ld b,#f6
	in a,(c)
	or #c0
	out (c),a
	and #3f
	out (c),a
	ld b,#f4
	out (c),c
	ld b,#f6
	ld c,a
	or #80
	out (c),a
	out (c),c
	ret
.lfd5d
	ld iy,lf9d1
	ld ix,lfa01
	ld e,#00
	call lfde6
	ld e,#01
	call lfde6
	ld e,#08
	call lfde6
	ld bc,#0018
	add ix,bc
	ld e,#02
	call lfde6
	ld e,#03
	call lfde6
	ld e,#09
	call lfde6
	ld bc,#0018
	add ix,bc
	ld e,#04
	call lfde6
	ld e,#05
	call lfde6
	ld e,#0a
	call lfde6
	ld e,#06
	ld a,(iy+#06)
	cp #ff
	jr nz,lfdac
	ld a,(iy+#16)
	cp #ff
	jr z,lfdb0
.lfdac
	ld d,a
	call lf9c7
.lfdb0
	ld ix,lfa01
	ld b,#03
	ld c,#09
	ld h,#00
	ld de,#0018
.lfdbd
	ld l,(iy+#17)
	ld a,(ix+#4d)
	and a
	jr z,lfdce
	inc a
	jr z,lfdce
	ld l,(iy+#07)
	jr lfdd6
.lfdce
	ld a,(ix+#05)
	and a
	jr nz,lfdd6
	ld l,#ff
.lfdd6
	ld a,l
	and c
	sla c
	or h
	ld h,a
	add ix,de
	djnz lfdbd
	ld d,h
	ld e,#07
	jp lf9c7
.lfde6
	ld a,e
	ld (lfdfd),a
	add #10
	ld (lfdf1),a
.lfdf1 equ $ + 2
	ld d,(iy+#00)
	ld a,(ix+#4d)
	and a
	jr z,lfdfe
	inc a
	jr z,lfdfe
.lfdfd equ $ + 2
	ld d,(iy+#00)
.lfdfe
	jp lf9c7
.lfe01
	push ix
	pop iy
	ld a,(ix+#13)
	and a
	jr z,lfe10
	ld de,#0006
	add iy,de
.lfe10
	ld l,(iy+#0c)
	ld h,(iy+#0d)
	ld e,(iy+#0e)
	ld d,#00
	add hl,de
	bit 7,(hl)
	jr nz,lfe27
	inc (iy+#0e)
	inc (iy+#0e)
	ret
.lfe27
	ld a,(hl)
	cp #94
	jp z,lfe77
	cp #95
	jp z,lfe88
	cp #9d
	jp z,lfeab
	cp #9e
	jp z,lfebf
	cp #ff
	jp z,lfed3
	cp #fe
	jp z,lfee2
	res 7,a
	add a
	ld e,a
	ld d,#00
	ld hl,lf9b3
	add hl,de
	ex de,hl
	ld hl,lf9c3
	sbc hl,de
	jr nc,lfe5b
	ld de,lf9b3
.lfe5b
	ex de,hl
	ld e,(hl)
	inc hl
	ld d,(hl)
	ex de,hl
	push bc
	push iy
	ld iy,lf9e1
	call lfb8f
	ld (ix+#09),#ff
	pop iy
	pop bc
	inc (iy+#0e)
	jp lfe01
.lfe77
	ld (iy+#0e),#00
	dec (ix+#0b)
	jp nz,lfe01
	ld (ix+#13),#00
	jp lfe01
.lfe88
	inc hl
	ld a,(hl)
	ld (ix+#0b),a
	inc hl
	ld a,(hl)
	ld (ix+#17),a
	inc hl
	ld a,(hl)
	ld (ix+#12),a
	inc hl
	ld a,(hl)
	ld (ix+#13),a
	ld a,(ix+#0e)
	add #05
	ld (ix+#0e),a
	ld (ix+#14),#00
	jp lfe01
.lfeab
	dec (iy+#0f)
	jr nz,lfeb6
	inc (iy+#0e)
	jp lfe01
.lfeb6
	ld a,(iy+#10)
	ld (iy+#0e),a
	jp lfe01
.lfebf
	inc (iy+#0e)
	inc (iy+#0e)
	ld a,(iy+#0e)
	ld (iy+#10),a
	inc hl
	ld a,(hl)
	ld (iy+#0f),a
	jp lfe01
.lfed3
	pop bc
	pop bc
	ld a,(lf9cc)
	ld c,a
	ld a,(lf9cb)
	call lfa91
	jp lfcea
.lfee2
	pop bc
	pop bc
	call lfb60
	jp lfcea
.lfeea
	ld a,(lf9ca)
	and a
	ret z
	ld ix,lfa01
	ld b,#03
.lfef5
	dec (ix+#0a)
	jr nz,lff27
	call lfe01
	ld a,(hl)
	and a
	jr z,lff04
	add (iy+#11)
.lff04
	add a
	ld e,a
	ld d,#00
	ld iy,lf3a7
	add iy,de
	ld e,(iy+#00)
	ld d,(iy+#01)
	ld (ix+#02),d
	ld (ix+#01),e
	inc hl
	ld a,(hl)
	ld (ix+#0a),a
	ld (ix+#06),#00
	ld (ix+#05),#01
.lff27
	ld de,#0018
	add ix,de
	djnz lfef5
	ret

.game_name
	db "Black Tiger",0
.game_year
	db "1989",0
.game_publisher
	db "U.S. Gold",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"

